import time

import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
driver=webdriver.Edge()
driver.get('https://www.126.com/')
driver.maximize_window()
time.sleep(3)
# driver.switch_to.frame(driver.find_element(By.XPATH,'//iframe[starts-with(@id,"x-URS-iframe1755313")]'))
# time.sleep(3)
# driver.find_element(By.XPATH,'//input[starts-with(@id,"auto-id")]').send_keys('1522057104@qq.com')
# time.sleep(3)
driver.switch_to.frame(driver.find_element(By.XPATH,'//iframe[starts-with(@id,"x-URS-iframe17")]'))
time.sleep(3)
driver.find_element(By.NAME,'email').send_keys('grq13381144084')
time.sleep(5)
driver.find_element(By.NAME,'password').send_keys('grq200566++')
time.sleep(5)
driver.find_element(By.XPATH,'//*[@id="dologin"]').click()
time.sleep(10)
driver.switch_to.default_content()
time.sleep(5)
driver.find_element(By.XPATH,'//*[@id="_mail_component_98_98"]/span[2]').click()
time.sleep(8)
driver.find_element(By.XPATH,'//input[@class="nui-editableAddr-ipt"]').send_keys('1522057104@qq.com')
time.sleep(5)
driver.find_element(By.XPATH,'//input[contains(@id,"_subjectInput")]').send_keys('顺顺利利')
time.sleep(8)
driver.find_element(By.XPATH,'/html/body/div[2]/div[1]/div/div[1]/section/footer/div[1]/span[2]').click()
time.sleep(5)